package org.university.dto.request;

import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.university.enums.GlobalEnums;

import java.time.LocalDate;

/**
 * 注册请求数据传输对象
 */
@Data
public class RegisterTeacherRequestDTO {

    @NotBlank(message = "teacherID不能为空")
    @Size(max = 50, message = "teacherID不可超过50位")
    private String teacherId;

    @NotBlank(message = "teacherName不能为空")
    @Size(min = 2, max = 50, message = "Username介于2到50个字符之间")
    private String teacherName;
    
//    @NotBlank(message = "gender不能为空")
    private GlobalEnums.Gender gender;

//    @NotBlank(message = "birthDate不能为空")
    private LocalDate birthDate;

    // @NotBlank只能用于 CharSequence类型（如 String）
//    @NotBlank(message = "hireDate不能为空")
    private LocalDate hireDate;

    /**
     * 所属学院ID
     */
    @NotNull(message = "[所属学院ID]不能为空")
    @ApiModelProperty("所属学院ID")
    private Integer deptId;
    /**
     * 班级ID
     */
    @NotNull(message = "title不能为空")
    @ApiModelProperty("教职")
    private String title;
    /**
     * 手机号码
     */
    @NotNull(message = "phone不能为空")
    @ApiModelProperty("手机号码")
    @Length(max = 15, message = "编码长度不能超过15")
    private String phone;
    /**
     * 电子邮箱地址
     */
    @NotNull(message = "email不能为空")
    @ApiModelProperty("电子邮箱地址")
    @Length(max = 100, message = "编码长度不能超过100")
    private String email;

    @NotBlank(message = "password不能为空")
    @Size(min = 8, max = 20, message = "password必须是8到20位有效字符")
    private String password;

    /**
     * 角色
     */
    private String role = "TEACHER";
}
